/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This file was generated.
 *  with google-apis-code-generator 1.2.0 (build: 2012-11-06 18:00:43 UTC)
 *  on 2012-11-06 at 19:41:44 UTC 
 */

package com.google.api.services.calendar;

import com.google.api.client.googleapis.GoogleUtils;
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest;
import com.google.api.client.googleapis.services.GoogleClientRequestInitializer;
import com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient;
import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
import com.google.api.client.util.DateTime;
import com.google.common.base.Preconditions;

/**
 * Service definition for Calendar (v3).
 *
 * <p>
 * Lets you manipulate events and other calendar data.
 * </p>
 *
 * <p>
 * For more information about this service, see the
 * <a href="https://developers.google.com/google-apps/calendar/firstapp" target="_blank">API Documentation</a>
 * </p>
 *
 * <p>
 * This service uses {@link CalendarRequestInitializer} to initialize global parameters via its
 * {@link Builder}.
 * </p>
 *
 * <p>
 * Upgrade warning: this class now extends {@link AbstractGoogleJsonClient}, whereas in prior
 * version 1.8 it extended {@link com.google.api.client.googleapis.services.GoogleClient}.
 * </p>
 *
 * @since 1.3
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public class Calendar extends AbstractGoogleJsonClient {

  // Note: Leave this static initializer at the top of the file.
  static {
    Preconditions.checkState(GoogleUtils.VERSION.equals("1.12.0-beta"),
        "You are currently running with version %s of google-api-client. " +
        "You need version 1.12.0-beta of google-api-client to run version " +
        "1.12.0-beta of the Calendar API library.", GoogleUtils.VERSION);
  }

  /**
   * The default encoded root URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_ROOT_URL = "https://www.googleapis.com/";

  /**
   * The default encoded service path of the service. This is determined when the library is
   * generated and normally should not be changed.
   *
   * @since 1.7
   */
  public static final String DEFAULT_SERVICE_PATH = "calendar/v3/";

  /**
   * The default encoded base URL of the service. This is determined when the library is generated
   * and normally should not be changed.
   * @deprecated (scheduled to be removed in 1.13)
   */
  @Deprecated
  public static final String DEFAULT_BASE_URL = DEFAULT_ROOT_URL + DEFAULT_SERVICE_PATH;

  /**
   * Constructor.
   *
   * <p>
   * Use {@link Builder} if you need to specify any of the optional parameters.
   * </p>
   *
   * @param transport HTTP transport
   * @param jsonFactory JSON factory
   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @since 1.7
   */
  public Calendar(HttpTransport transport, JsonFactory jsonFactory,
      HttpRequestInitializer httpRequestInitializer) {
    super(transport,
        jsonFactory,
        DEFAULT_ROOT_URL,
        DEFAULT_SERVICE_PATH,
        httpRequestInitializer,
        false);
  }

  /**
   * @param transport HTTP transport
   * @param httpRequestInitializer HTTP request initializer or {@code null} for none
   * @param rootUrl root URL of the service
   * @param servicePath service path
   * @param jsonObjectParser JSON object parser
   * @param googleClientRequestInitializer Google request initializer or {@code null} for none
   * @param applicationName application name to be sent in the User-Agent header of requests or
   *        {@code null} for none
   * @param suppressPatternChecks whether discovery pattern checks should be suppressed on required
   *        parameters
   */
  Calendar(HttpTransport transport,
      HttpRequestInitializer httpRequestInitializer,
      String rootUrl,
      String servicePath,
      JsonObjectParser jsonObjectParser,
      GoogleClientRequestInitializer googleClientRequestInitializer,
      String applicationName,
      boolean suppressPatternChecks) {
    super(transport,
        httpRequestInitializer,
        rootUrl,
        servicePath,
        jsonObjectParser,
        googleClientRequestInitializer,
        applicationName,
        suppressPatternChecks);
  }

  @Override
  protected void initialize(AbstractGoogleClientRequest<?> httpClientRequest) throws java.io.IOException {
    super.initialize(httpClientRequest);
  }

  /**
   * An accessor for creating requests from the Freebusy collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.Freebusy.List request = calendar.freebusy().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Freebusy freebusy() {
    return new Freebusy();
  }

  /**
   * The "freebusy" collection of methods.
   */
  public class Freebusy {

    /**
     * Returns free/busy information for a set of calendars.
     *
     * Create a request for the method "freebusy.query".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Query#execute()} method to invoke the remote operation.
     *
     * @param content the {@link com.google.api.services.calendar.model.FreeBusyRequest}
     * @return the request
     */
    public Query query(com.google.api.services.calendar.model.FreeBusyRequest content) throws java.io.IOException {
      Query result = new Query(content);
      initialize(result);
      return result;
    }

    public class Query extends CalendarRequest<com.google.api.services.calendar.model.FreeBusyResponse> {

      private static final String REST_PATH = "freeBusy";

      Query(com.google.api.services.calendar.model.FreeBusyRequest content) {
        super(Calendar.this, "POST", REST_PATH, content, com.google.api.services.calendar.model.FreeBusyResponse.class);
      }

      @Override
      public Query setPrettyPrint(Boolean prettyPrint) {
        return (Query) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Query setFields(String fields) {
        return (Query) super.setFields(fields);
      }

      @Override
      public Query setQuotaUser(String quotaUser) {
        return (Query) super.setQuotaUser(quotaUser);
      }

      @Override
      public Query setOauthToken(String oauthToken) {
        return (Query) super.setOauthToken(oauthToken);
      }

      @Override
      public Query setKey(String key) {
        return (Query) super.setKey(key);
      }

      @Override
      public Query setUserIp(String userIp) {
        return (Query) super.setUserIp(userIp);
      }

      @Override
      public Query setAlt(String alt) {
        return (Query) super.setAlt(alt);
      }

    }

  }

  /**
   * An accessor for creating requests from the Settings collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.Settings.List request = calendar.settings().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Settings settings() {
    return new Settings();
  }

  /**
   * The "settings" collection of methods.
   */
  public class Settings {

    /**
     * Returns all user settings for the authenticated user.
     *
     * Create a request for the method "settings.list".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @return the request
     */
    public List list() throws java.io.IOException {
      List result = new List();
      initialize(result);
      return result;
    }

    public class List extends CalendarRequest<com.google.api.services.calendar.model.Settings> {

      private static final String REST_PATH = "users/me/settings";

      List() {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Settings.class);
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List setPrettyPrint(Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setFields(String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setQuotaUser(String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setOauthToken(String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setKey(String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setUserIp(String userIp) {
        return (List) super.setUserIp(userIp);
      }

      @Override
      public List setAlt(String alt) {
        return (List) super.setAlt(alt);
      }

    }
    /**
     * Returns a single user setting.
     *
     * Create a request for the method "settings.get".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param setting Name of the user setting.
     * @return the request
     */
    public Get get(String setting) throws java.io.IOException {
      Get result = new Get(setting);
      initialize(result);
      return result;
    }

    public class Get extends CalendarRequest<com.google.api.services.calendar.model.Setting> {

      private static final String REST_PATH = "users/me/settings/{setting}";

      Get(String setting) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Setting.class);
        this.setting = Preconditions.checkNotNull(setting, "Required parameter setting must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setPrettyPrint(Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setFields(String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setQuotaUser(String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setOauthToken(String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setKey(String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setUserIp(String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      @Override
      public Get setAlt(String alt) {
        return (Get) super.setAlt(alt);
      }

      /** Name of the user setting. */
      @com.google.api.client.util.Key
      private String setting;

      /** Name of the user setting.
       */
      public String getSetting() {
        return setting;
      }

      /** Name of the user setting. */
      public Get setSetting(String setting) {
        this.setting = setting;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the CalendarList collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.CalendarList.List request = calendar.calendarList().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public CalendarList calendarList() {
    return new CalendarList();
  }

  /**
   * The "calendarList" collection of methods.
   */
  public class CalendarList {

    /**
     * Adds an entry to the user's calendar list.
     *
     * Create a request for the method "calendarList.insert".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param content the {@link com.google.api.services.calendar.model.CalendarListEntry}
     * @return the request
     */
    public Insert insert(com.google.api.services.calendar.model.CalendarListEntry content) throws java.io.IOException {
      Insert result = new Insert(content);
      initialize(result);
      return result;
    }

    public class Insert extends CalendarRequest<com.google.api.services.calendar.model.CalendarListEntry> {

      private static final String REST_PATH = "users/me/calendarList";

      Insert(com.google.api.services.calendar.model.CalendarListEntry content) {
        super(Calendar.this, "POST", REST_PATH, content, com.google.api.services.calendar.model.CalendarListEntry.class);
      }

      @Override
      public Insert setPrettyPrint(Boolean prettyPrint) {
        return (Insert) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Insert setFields(String fields) {
        return (Insert) super.setFields(fields);
      }

      @Override
      public Insert setQuotaUser(String quotaUser) {
        return (Insert) super.setQuotaUser(quotaUser);
      }

      @Override
      public Insert setOauthToken(String oauthToken) {
        return (Insert) super.setOauthToken(oauthToken);
      }

      @Override
      public Insert setKey(String key) {
        return (Insert) super.setKey(key);
      }

      @Override
      public Insert setUserIp(String userIp) {
        return (Insert) super.setUserIp(userIp);
      }

      @Override
      public Insert setAlt(String alt) {
        return (Insert) super.setAlt(alt);
      }

      /**
     * Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors
     * (RGB). If this feature is used, the index-based 'color' field will be set to the best
     * matching option automatically. Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean colorRgbFormat;

      /** Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors (RGB).
     If this feature is used, the index-based 'color' field will be set to the best matching option
     automatically. Optional. The default is False.
       */
      public Boolean getColorRgbFormat() {
        return colorRgbFormat;
      }

      /**
     * Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors
     * (RGB). If this feature is used, the index-based 'color' field will be set to the best
     * matching option automatically. Optional. The default is False.
     */
      public Insert setColorRgbFormat(Boolean colorRgbFormat) {
        this.colorRgbFormat = colorRgbFormat;
        return this;
      }

    }
    /**
     * Returns an entry on the user's calendar list.
     *
     * Create a request for the method "calendarList.get".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public Get get(String calendarId) throws java.io.IOException {
      Get result = new Get(calendarId);
      initialize(result);
      return result;
    }

    public class Get extends CalendarRequest<com.google.api.services.calendar.model.CalendarListEntry> {

      private static final String REST_PATH = "users/me/calendarList/{calendarId}";

      Get(String calendarId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.CalendarListEntry.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setPrettyPrint(Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setFields(String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setQuotaUser(String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setOauthToken(String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setKey(String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setUserIp(String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      @Override
      public Get setAlt(String alt) {
        return (Get) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Get setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Returns entries on the user's calendar list.
     *
     * Create a request for the method "calendarList.list".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @return the request
     */
    public List list() throws java.io.IOException {
      List result = new List();
      initialize(result);
      return result;
    }

    public class List extends CalendarRequest<com.google.api.services.calendar.model.CalendarList> {

      private static final String REST_PATH = "users/me/calendarList";

      List() {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.CalendarList.class);
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List setPrettyPrint(Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setFields(String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setQuotaUser(String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setOauthToken(String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setKey(String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setUserIp(String userIp) {
        return (List) super.setUserIp(userIp);
      }

      @Override
      public List setAlt(String alt) {
        return (List) super.setAlt(alt);
      }

      /** Token specifying which result page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Token specifying which result page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Token specifying which result page to return. Optional. */
      public List setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /** Whether to show hidden entries. Optional. The default is False. */
      @com.google.api.client.util.Key
      private Boolean showHidden;

      /** Whether to show hidden entries. Optional. The default is False.
       */
      public Boolean getShowHidden() {
        return showHidden;
      }

      /** Whether to show hidden entries. Optional. The default is False. */
      public List setShowHidden(Boolean showHidden) {
        this.showHidden = showHidden;
        return this;
      }

      /** Maximum number of entries returned on one result page. Optional. */
      @com.google.api.client.util.Key
      private Integer maxResults;

      /** Maximum number of entries returned on one result page. Optional.

     [minimum: 1]
       */
      public Integer getMaxResults() {
        return maxResults;
      }

      /** Maximum number of entries returned on one result page. Optional. */
      public List setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /**
     * The minimum access role for the user in the returned entires. Optional. The default is no
     * restriction.
     */
      @com.google.api.client.util.Key
      private String minAccessRole;

      /** The minimum access role for the user in the returned entires. Optional. The default is no
     restriction.
       */
      public String getMinAccessRole() {
        return minAccessRole;
      }

      /**
     * The minimum access role for the user in the returned entires. Optional. The default is no
     * restriction.
     */
      public List setMinAccessRole(String minAccessRole) {
        this.minAccessRole = minAccessRole;
        return this;
      }

    }
    /**
     * Updates an entry on the user's calendar list.
     *
     * Create a request for the method "calendarList.update".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.CalendarListEntry}
     * @return the request
     */
    public Update update(String calendarId, com.google.api.services.calendar.model.CalendarListEntry content) throws java.io.IOException {
      Update result = new Update(calendarId, content);
      initialize(result);
      return result;
    }

    public class Update extends CalendarRequest<com.google.api.services.calendar.model.CalendarListEntry> {

      private static final String REST_PATH = "users/me/calendarList/{calendarId}";

      Update(String calendarId, com.google.api.services.calendar.model.CalendarListEntry content) {
        super(Calendar.this, "PUT", REST_PATH, content, com.google.api.services.calendar.model.CalendarListEntry.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Update setPrettyPrint(Boolean prettyPrint) {
        return (Update) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Update setFields(String fields) {
        return (Update) super.setFields(fields);
      }

      @Override
      public Update setQuotaUser(String quotaUser) {
        return (Update) super.setQuotaUser(quotaUser);
      }

      @Override
      public Update setOauthToken(String oauthToken) {
        return (Update) super.setOauthToken(oauthToken);
      }

      @Override
      public Update setKey(String key) {
        return (Update) super.setKey(key);
      }

      @Override
      public Update setUserIp(String userIp) {
        return (Update) super.setUserIp(userIp);
      }

      @Override
      public Update setAlt(String alt) {
        return (Update) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Update setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /**
     * Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors
     * (RGB). If this feature is used, the index-based 'color' field will be set to the best
     * matching option automatically. Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean colorRgbFormat;

      /** Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors (RGB).
     If this feature is used, the index-based 'color' field will be set to the best matching option
     automatically. Optional. The default is False.
       */
      public Boolean getColorRgbFormat() {
        return colorRgbFormat;
      }

      /**
     * Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors
     * (RGB). If this feature is used, the index-based 'color' field will be set to the best
     * matching option automatically. Optional. The default is False.
     */
      public Update setColorRgbFormat(Boolean colorRgbFormat) {
        this.colorRgbFormat = colorRgbFormat;
        return this;
      }

    }
    /**
     * Updates an entry on the user's calendar list. This method supports patch semantics.
     *
     * Create a request for the method "calendarList.patch".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.CalendarListEntry}
     * @return the request
     */
    public Patch patch(String calendarId, com.google.api.services.calendar.model.CalendarListEntry content) throws java.io.IOException {
      Patch result = new Patch(calendarId, content);
      initialize(result);
      return result;
    }

    public class Patch extends CalendarRequest<com.google.api.services.calendar.model.CalendarListEntry> {

      private static final String REST_PATH = "users/me/calendarList/{calendarId}";

      Patch(String calendarId, com.google.api.services.calendar.model.CalendarListEntry content) {
        super(Calendar.this, "PATCH", REST_PATH, content, com.google.api.services.calendar.model.CalendarListEntry.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Patch setPrettyPrint(Boolean prettyPrint) {
        return (Patch) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Patch setFields(String fields) {
        return (Patch) super.setFields(fields);
      }

      @Override
      public Patch setQuotaUser(String quotaUser) {
        return (Patch) super.setQuotaUser(quotaUser);
      }

      @Override
      public Patch setOauthToken(String oauthToken) {
        return (Patch) super.setOauthToken(oauthToken);
      }

      @Override
      public Patch setKey(String key) {
        return (Patch) super.setKey(key);
      }

      @Override
      public Patch setUserIp(String userIp) {
        return (Patch) super.setUserIp(userIp);
      }

      @Override
      public Patch setAlt(String alt) {
        return (Patch) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Patch setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /**
     * Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors
     * (RGB). If this feature is used, the index-based 'color' field will be set to the best
     * matching option automatically. Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean colorRgbFormat;

      /** Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors (RGB).
     If this feature is used, the index-based 'color' field will be set to the best matching option
     automatically. Optional. The default is False.
       */
      public Boolean getColorRgbFormat() {
        return colorRgbFormat;
      }

      /**
     * Whether to use the 'frontendColor' and 'backgroundColor' fields to write the calendar colors
     * (RGB). If this feature is used, the index-based 'color' field will be set to the best
     * matching option automatically. Optional. The default is False.
     */
      public Patch setColorRgbFormat(Boolean colorRgbFormat) {
        this.colorRgbFormat = colorRgbFormat;
        return this;
      }

    }
    /**
     * Deletes an entry on the user's calendar list.
     *
     * Create a request for the method "calendarList.delete".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public Delete delete(String calendarId) throws java.io.IOException {
      Delete result = new Delete(calendarId);
      initialize(result);
      return result;
    }

    public class Delete extends CalendarRequest<Void> {

      private static final String REST_PATH = "users/me/calendarList/{calendarId}";

      Delete(String calendarId) {
        super(Calendar.this, "DELETE", REST_PATH, null, Void.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Delete setPrettyPrint(Boolean prettyPrint) {
        return (Delete) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Delete setFields(String fields) {
        return (Delete) super.setFields(fields);
      }

      @Override
      public Delete setQuotaUser(String quotaUser) {
        return (Delete) super.setQuotaUser(quotaUser);
      }

      @Override
      public Delete setOauthToken(String oauthToken) {
        return (Delete) super.setOauthToken(oauthToken);
      }

      @Override
      public Delete setKey(String key) {
        return (Delete) super.setKey(key);
      }

      @Override
      public Delete setUserIp(String userIp) {
        return (Delete) super.setUserIp(userIp);
      }

      @Override
      public Delete setAlt(String alt) {
        return (Delete) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Delete setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Calendars collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.Calendars.List request = calendar.calendars().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Calendars calendars() {
    return new Calendars();
  }

  /**
   * The "calendars" collection of methods.
   */
  public class Calendars {

    /**
     * Creates a secondary calendar.
     *
     * Create a request for the method "calendars.insert".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param content the {@link com.google.api.services.calendar.model.Calendar}
     * @return the request
     */
    public Insert insert(com.google.api.services.calendar.model.Calendar content) throws java.io.IOException {
      Insert result = new Insert(content);
      initialize(result);
      return result;
    }

    public class Insert extends CalendarRequest<com.google.api.services.calendar.model.Calendar> {

      private static final String REST_PATH = "calendars";

      Insert(com.google.api.services.calendar.model.Calendar content) {
        super(Calendar.this, "POST", REST_PATH, content, com.google.api.services.calendar.model.Calendar.class);
      }

      @Override
      public Insert setPrettyPrint(Boolean prettyPrint) {
        return (Insert) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Insert setFields(String fields) {
        return (Insert) super.setFields(fields);
      }

      @Override
      public Insert setQuotaUser(String quotaUser) {
        return (Insert) super.setQuotaUser(quotaUser);
      }

      @Override
      public Insert setOauthToken(String oauthToken) {
        return (Insert) super.setOauthToken(oauthToken);
      }

      @Override
      public Insert setKey(String key) {
        return (Insert) super.setKey(key);
      }

      @Override
      public Insert setUserIp(String userIp) {
        return (Insert) super.setUserIp(userIp);
      }

      @Override
      public Insert setAlt(String alt) {
        return (Insert) super.setAlt(alt);
      }

    }
    /**
     * Returns metadata for a calendar.
     *
     * Create a request for the method "calendars.get".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public Get get(String calendarId) throws java.io.IOException {
      Get result = new Get(calendarId);
      initialize(result);
      return result;
    }

    public class Get extends CalendarRequest<com.google.api.services.calendar.model.Calendar> {

      private static final String REST_PATH = "calendars/{calendarId}";

      Get(String calendarId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Calendar.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setPrettyPrint(Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setFields(String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setQuotaUser(String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setOauthToken(String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setKey(String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setUserIp(String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      @Override
      public Get setAlt(String alt) {
        return (Get) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Get setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Clears a primary calendar. This operation deletes all data associated with the primary calendar
     * of an account and cannot be undone.
     *
     * Create a request for the method "calendars.clear".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Clear#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public Clear clear(String calendarId) throws java.io.IOException {
      Clear result = new Clear(calendarId);
      initialize(result);
      return result;
    }

    public class Clear extends CalendarRequest<Void> {

      private static final String REST_PATH = "calendars/{calendarId}/clear";

      Clear(String calendarId) {
        super(Calendar.this, "POST", REST_PATH, null, Void.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Clear setPrettyPrint(Boolean prettyPrint) {
        return (Clear) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Clear setFields(String fields) {
        return (Clear) super.setFields(fields);
      }

      @Override
      public Clear setQuotaUser(String quotaUser) {
        return (Clear) super.setQuotaUser(quotaUser);
      }

      @Override
      public Clear setOauthToken(String oauthToken) {
        return (Clear) super.setOauthToken(oauthToken);
      }

      @Override
      public Clear setKey(String key) {
        return (Clear) super.setKey(key);
      }

      @Override
      public Clear setUserIp(String userIp) {
        return (Clear) super.setUserIp(userIp);
      }

      @Override
      public Clear setAlt(String alt) {
        return (Clear) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Clear setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Updates metadata for a calendar.
     *
     * Create a request for the method "calendars.update".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.Calendar}
     * @return the request
     */
    public Update update(String calendarId, com.google.api.services.calendar.model.Calendar content) throws java.io.IOException {
      Update result = new Update(calendarId, content);
      initialize(result);
      return result;
    }

    public class Update extends CalendarRequest<com.google.api.services.calendar.model.Calendar> {

      private static final String REST_PATH = "calendars/{calendarId}";

      Update(String calendarId, com.google.api.services.calendar.model.Calendar content) {
        super(Calendar.this, "PUT", REST_PATH, content, com.google.api.services.calendar.model.Calendar.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Update setPrettyPrint(Boolean prettyPrint) {
        return (Update) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Update setFields(String fields) {
        return (Update) super.setFields(fields);
      }

      @Override
      public Update setQuotaUser(String quotaUser) {
        return (Update) super.setQuotaUser(quotaUser);
      }

      @Override
      public Update setOauthToken(String oauthToken) {
        return (Update) super.setOauthToken(oauthToken);
      }

      @Override
      public Update setKey(String key) {
        return (Update) super.setKey(key);
      }

      @Override
      public Update setUserIp(String userIp) {
        return (Update) super.setUserIp(userIp);
      }

      @Override
      public Update setAlt(String alt) {
        return (Update) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Update setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Updates metadata for a calendar. This method supports patch semantics.
     *
     * Create a request for the method "calendars.patch".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.Calendar}
     * @return the request
     */
    public Patch patch(String calendarId, com.google.api.services.calendar.model.Calendar content) throws java.io.IOException {
      Patch result = new Patch(calendarId, content);
      initialize(result);
      return result;
    }

    public class Patch extends CalendarRequest<com.google.api.services.calendar.model.Calendar> {

      private static final String REST_PATH = "calendars/{calendarId}";

      Patch(String calendarId, com.google.api.services.calendar.model.Calendar content) {
        super(Calendar.this, "PATCH", REST_PATH, content, com.google.api.services.calendar.model.Calendar.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Patch setPrettyPrint(Boolean prettyPrint) {
        return (Patch) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Patch setFields(String fields) {
        return (Patch) super.setFields(fields);
      }

      @Override
      public Patch setQuotaUser(String quotaUser) {
        return (Patch) super.setQuotaUser(quotaUser);
      }

      @Override
      public Patch setOauthToken(String oauthToken) {
        return (Patch) super.setOauthToken(oauthToken);
      }

      @Override
      public Patch setKey(String key) {
        return (Patch) super.setKey(key);
      }

      @Override
      public Patch setUserIp(String userIp) {
        return (Patch) super.setUserIp(userIp);
      }

      @Override
      public Patch setAlt(String alt) {
        return (Patch) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Patch setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Deletes a secondary calendar.
     *
     * Create a request for the method "calendars.delete".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public Delete delete(String calendarId) throws java.io.IOException {
      Delete result = new Delete(calendarId);
      initialize(result);
      return result;
    }

    public class Delete extends CalendarRequest<Void> {

      private static final String REST_PATH = "calendars/{calendarId}";

      Delete(String calendarId) {
        super(Calendar.this, "DELETE", REST_PATH, null, Void.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Delete setPrettyPrint(Boolean prettyPrint) {
        return (Delete) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Delete setFields(String fields) {
        return (Delete) super.setFields(fields);
      }

      @Override
      public Delete setQuotaUser(String quotaUser) {
        return (Delete) super.setQuotaUser(quotaUser);
      }

      @Override
      public Delete setOauthToken(String oauthToken) {
        return (Delete) super.setOauthToken(oauthToken);
      }

      @Override
      public Delete setKey(String key) {
        return (Delete) super.setKey(key);
      }

      @Override
      public Delete setUserIp(String userIp) {
        return (Delete) super.setUserIp(userIp);
      }

      @Override
      public Delete setAlt(String alt) {
        return (Delete) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Delete setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Acl collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.Acl.List request = calendar.acl().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Acl acl() {
    return new Acl();
  }

  /**
   * The "acl" collection of methods.
   */
  public class Acl {

    /**
     * Creates an access control rule.
     *
     * Create a request for the method "acl.insert".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.AclRule}
     * @return the request
     */
    public Insert insert(String calendarId, com.google.api.services.calendar.model.AclRule content) throws java.io.IOException {
      Insert result = new Insert(calendarId, content);
      initialize(result);
      return result;
    }

    public class Insert extends CalendarRequest<com.google.api.services.calendar.model.AclRule> {

      private static final String REST_PATH = "calendars/{calendarId}/acl";

      Insert(String calendarId, com.google.api.services.calendar.model.AclRule content) {
        super(Calendar.this, "POST", REST_PATH, content, com.google.api.services.calendar.model.AclRule.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Insert setPrettyPrint(Boolean prettyPrint) {
        return (Insert) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Insert setFields(String fields) {
        return (Insert) super.setFields(fields);
      }

      @Override
      public Insert setQuotaUser(String quotaUser) {
        return (Insert) super.setQuotaUser(quotaUser);
      }

      @Override
      public Insert setOauthToken(String oauthToken) {
        return (Insert) super.setOauthToken(oauthToken);
      }

      @Override
      public Insert setKey(String key) {
        return (Insert) super.setKey(key);
      }

      @Override
      public Insert setUserIp(String userIp) {
        return (Insert) super.setUserIp(userIp);
      }

      @Override
      public Insert setAlt(String alt) {
        return (Insert) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Insert setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Returns an access control rule.
     *
     * Create a request for the method "acl.get".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param ruleId ACL rule identifier.
     * @return the request
     */
    public Get get(String calendarId, String ruleId) throws java.io.IOException {
      Get result = new Get(calendarId, ruleId);
      initialize(result);
      return result;
    }

    public class Get extends CalendarRequest<com.google.api.services.calendar.model.AclRule> {

      private static final String REST_PATH = "calendars/{calendarId}/acl/{ruleId}";

      Get(String calendarId, String ruleId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.AclRule.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.ruleId = Preconditions.checkNotNull(ruleId, "Required parameter ruleId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setPrettyPrint(Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setFields(String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setQuotaUser(String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setOauthToken(String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setKey(String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setUserIp(String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      @Override
      public Get setAlt(String alt) {
        return (Get) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Get setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** ACL rule identifier. */
      @com.google.api.client.util.Key
      private String ruleId;

      /** ACL rule identifier.
       */
      public String getRuleId() {
        return ruleId;
      }

      /** ACL rule identifier. */
      public Get setRuleId(String ruleId) {
        this.ruleId = ruleId;
        return this;
      }

    }
    /**
     * Returns the rules in the access control list for the calendar.
     *
     * Create a request for the method "acl.list".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public List list(String calendarId) throws java.io.IOException {
      List result = new List(calendarId);
      initialize(result);
      return result;
    }

    public class List extends CalendarRequest<com.google.api.services.calendar.model.Acl> {

      private static final String REST_PATH = "calendars/{calendarId}/acl";

      List(String calendarId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Acl.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List setPrettyPrint(Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setFields(String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setQuotaUser(String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setOauthToken(String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setKey(String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setUserIp(String userIp) {
        return (List) super.setUserIp(userIp);
      }

      @Override
      public List setAlt(String alt) {
        return (List) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public List setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Updates an access control rule.
     *
     * Create a request for the method "acl.update".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param ruleId ACL rule identifier.
     * @param content the {@link com.google.api.services.calendar.model.AclRule}
     * @return the request
     */
    public Update update(String calendarId, String ruleId, com.google.api.services.calendar.model.AclRule content) throws java.io.IOException {
      Update result = new Update(calendarId, ruleId, content);
      initialize(result);
      return result;
    }

    public class Update extends CalendarRequest<com.google.api.services.calendar.model.AclRule> {

      private static final String REST_PATH = "calendars/{calendarId}/acl/{ruleId}";

      Update(String calendarId, String ruleId, com.google.api.services.calendar.model.AclRule content) {
        super(Calendar.this, "PUT", REST_PATH, content, com.google.api.services.calendar.model.AclRule.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.ruleId = Preconditions.checkNotNull(ruleId, "Required parameter ruleId must be specified.");
      }

      @Override
      public Update setPrettyPrint(Boolean prettyPrint) {
        return (Update) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Update setFields(String fields) {
        return (Update) super.setFields(fields);
      }

      @Override
      public Update setQuotaUser(String quotaUser) {
        return (Update) super.setQuotaUser(quotaUser);
      }

      @Override
      public Update setOauthToken(String oauthToken) {
        return (Update) super.setOauthToken(oauthToken);
      }

      @Override
      public Update setKey(String key) {
        return (Update) super.setKey(key);
      }

      @Override
      public Update setUserIp(String userIp) {
        return (Update) super.setUserIp(userIp);
      }

      @Override
      public Update setAlt(String alt) {
        return (Update) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Update setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** ACL rule identifier. */
      @com.google.api.client.util.Key
      private String ruleId;

      /** ACL rule identifier.
       */
      public String getRuleId() {
        return ruleId;
      }

      /** ACL rule identifier. */
      public Update setRuleId(String ruleId) {
        this.ruleId = ruleId;
        return this;
      }

    }
    /**
     * Updates an access control rule. This method supports patch semantics.
     *
     * Create a request for the method "acl.patch".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param ruleId ACL rule identifier.
     * @param content the {@link com.google.api.services.calendar.model.AclRule}
     * @return the request
     */
    public Patch patch(String calendarId, String ruleId, com.google.api.services.calendar.model.AclRule content) throws java.io.IOException {
      Patch result = new Patch(calendarId, ruleId, content);
      initialize(result);
      return result;
    }

    public class Patch extends CalendarRequest<com.google.api.services.calendar.model.AclRule> {

      private static final String REST_PATH = "calendars/{calendarId}/acl/{ruleId}";

      Patch(String calendarId, String ruleId, com.google.api.services.calendar.model.AclRule content) {
        super(Calendar.this, "PATCH", REST_PATH, content, com.google.api.services.calendar.model.AclRule.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.ruleId = Preconditions.checkNotNull(ruleId, "Required parameter ruleId must be specified.");
      }

      @Override
      public Patch setPrettyPrint(Boolean prettyPrint) {
        return (Patch) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Patch setFields(String fields) {
        return (Patch) super.setFields(fields);
      }

      @Override
      public Patch setQuotaUser(String quotaUser) {
        return (Patch) super.setQuotaUser(quotaUser);
      }

      @Override
      public Patch setOauthToken(String oauthToken) {
        return (Patch) super.setOauthToken(oauthToken);
      }

      @Override
      public Patch setKey(String key) {
        return (Patch) super.setKey(key);
      }

      @Override
      public Patch setUserIp(String userIp) {
        return (Patch) super.setUserIp(userIp);
      }

      @Override
      public Patch setAlt(String alt) {
        return (Patch) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Patch setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** ACL rule identifier. */
      @com.google.api.client.util.Key
      private String ruleId;

      /** ACL rule identifier.
       */
      public String getRuleId() {
        return ruleId;
      }

      /** ACL rule identifier. */
      public Patch setRuleId(String ruleId) {
        this.ruleId = ruleId;
        return this;
      }

    }
    /**
     * Deletes an access control rule.
     *
     * Create a request for the method "acl.delete".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param ruleId ACL rule identifier.
     * @return the request
     */
    public Delete delete(String calendarId, String ruleId) throws java.io.IOException {
      Delete result = new Delete(calendarId, ruleId);
      initialize(result);
      return result;
    }

    public class Delete extends CalendarRequest<Void> {

      private static final String REST_PATH = "calendars/{calendarId}/acl/{ruleId}";

      Delete(String calendarId, String ruleId) {
        super(Calendar.this, "DELETE", REST_PATH, null, Void.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.ruleId = Preconditions.checkNotNull(ruleId, "Required parameter ruleId must be specified.");
      }

      @Override
      public Delete setPrettyPrint(Boolean prettyPrint) {
        return (Delete) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Delete setFields(String fields) {
        return (Delete) super.setFields(fields);
      }

      @Override
      public Delete setQuotaUser(String quotaUser) {
        return (Delete) super.setQuotaUser(quotaUser);
      }

      @Override
      public Delete setOauthToken(String oauthToken) {
        return (Delete) super.setOauthToken(oauthToken);
      }

      @Override
      public Delete setKey(String key) {
        return (Delete) super.setKey(key);
      }

      @Override
      public Delete setUserIp(String userIp) {
        return (Delete) super.setUserIp(userIp);
      }

      @Override
      public Delete setAlt(String alt) {
        return (Delete) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Delete setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** ACL rule identifier. */
      @com.google.api.client.util.Key
      private String ruleId;

      /** ACL rule identifier.
       */
      public String getRuleId() {
        return ruleId;
      }

      /** ACL rule identifier. */
      public Delete setRuleId(String ruleId) {
        this.ruleId = ruleId;
        return this;
      }

    }

  }

  /**
   * An accessor for creating requests from the Colors collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.Colors.List request = calendar.colors().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Colors colors() {
    return new Colors();
  }

  /**
   * The "colors" collection of methods.
   */
  public class Colors {

    /**
     * Returns the color definitions for calendars and events.
     *
     * Create a request for the method "colors.get".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @return the request
     */
    public Get get() throws java.io.IOException {
      Get result = new Get();
      initialize(result);
      return result;
    }

    public class Get extends CalendarRequest<com.google.api.services.calendar.model.Colors> {

      private static final String REST_PATH = "colors";

      Get() {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Colors.class);
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setPrettyPrint(Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setFields(String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setQuotaUser(String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setOauthToken(String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setKey(String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setUserIp(String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      @Override
      public Get setAlt(String alt) {
        return (Get) super.setAlt(alt);
      }

    }

  }

  /**
   * An accessor for creating requests from the Events collection.
   *
   * <p>The typical use is:</p>
   * <pre>
   *   {@code Calendar calendar = new Calendar(...);}
   *   {@code Calendar.Events.List request = calendar.events().list(parameters ...)}
   * </pre>
   *
   * @return the resource collection
   */
  public Events events() {
    return new Events();
  }

  /**
   * The "events" collection of methods.
   */
  public class Events {

    /**
     * Creates an event.
     *
     * Create a request for the method "events.insert".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Insert#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.Event}
     * @return the request
     */
    public Insert insert(String calendarId, com.google.api.services.calendar.model.Event content) throws java.io.IOException {
      Insert result = new Insert(calendarId, content);
      initialize(result);
      return result;
    }

    public class Insert extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events";

      Insert(String calendarId, com.google.api.services.calendar.model.Event content) {
        super(Calendar.this, "POST", REST_PATH, content, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public Insert setPrettyPrint(Boolean prettyPrint) {
        return (Insert) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Insert setFields(String fields) {
        return (Insert) super.setFields(fields);
      }

      @Override
      public Insert setQuotaUser(String quotaUser) {
        return (Insert) super.setQuotaUser(quotaUser);
      }

      @Override
      public Insert setOauthToken(String oauthToken) {
        return (Insert) super.setOauthToken(oauthToken);
      }

      @Override
      public Insert setKey(String key) {
        return (Insert) super.setKey(key);
      }

      @Override
      public Insert setUserIp(String userIp) {
        return (Insert) super.setUserIp(userIp);
      }

      @Override
      public Insert setAlt(String alt) {
        return (Insert) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Insert setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /**
     * Whether to send notifications about the creation of the new event. Optional. The default is
     * False.
     */
      @com.google.api.client.util.Key
      private Boolean sendNotifications;

      /** Whether to send notifications about the creation of the new event. Optional. The default is False.
       */
      public Boolean getSendNotifications() {
        return sendNotifications;
      }

      /**
     * Whether to send notifications about the creation of the new event. Optional. The default is
     * False.
     */
      public Insert setSendNotifications(Boolean sendNotifications) {
        this.sendNotifications = sendNotifications;
        return this;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      @com.google.api.client.util.Key
      private Integer maxAttendees;

      /** The maximum number of attendees to include in the response. If there are more than the specified
     number of attendees, only the participant is returned. Optional.

     [minimum: 1]
       */
      public Integer getMaxAttendees() {
        return maxAttendees;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      public Insert setMaxAttendees(Integer maxAttendees) {
        this.maxAttendees = maxAttendees;
        return this;
      }

    }
    /**
     * Returns an event.
     *
     * Create a request for the method "events.get".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Get#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param eventId Event identifier.
     * @return the request
     */
    public Get get(String calendarId, String eventId) throws java.io.IOException {
      Get result = new Get(calendarId, eventId);
      initialize(result);
      return result;
    }

    public class Get extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events/{eventId}";

      Get(String calendarId, String eventId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.eventId = Preconditions.checkNotNull(eventId, "Required parameter eventId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Get setPrettyPrint(Boolean prettyPrint) {
        return (Get) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Get setFields(String fields) {
        return (Get) super.setFields(fields);
      }

      @Override
      public Get setQuotaUser(String quotaUser) {
        return (Get) super.setQuotaUser(quotaUser);
      }

      @Override
      public Get setOauthToken(String oauthToken) {
        return (Get) super.setOauthToken(oauthToken);
      }

      @Override
      public Get setKey(String key) {
        return (Get) super.setKey(key);
      }

      @Override
      public Get setUserIp(String userIp) {
        return (Get) super.setUserIp(userIp);
      }

      @Override
      public Get setAlt(String alt) {
        return (Get) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Get setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** Event identifier. */
      @com.google.api.client.util.Key
      private String eventId;

      /** Event identifier.
       */
      public String getEventId() {
        return eventId;
      }

      /** Event identifier. */
      public Get setEventId(String eventId) {
        this.eventId = eventId;
        return this;
      }

      /** Time zone used in the response. Optional. The default is the time zone of the calendar. */
      @com.google.api.client.util.Key
      private String timeZone;

      /** Time zone used in the response. Optional. The default is the time zone of the calendar.
       */
      public String getTimeZone() {
        return timeZone;
      }

      /** Time zone used in the response. Optional. The default is the time zone of the calendar. */
      public Get setTimeZone(String timeZone) {
        this.timeZone = timeZone;
        return this;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      @com.google.api.client.util.Key
      private Boolean alwaysIncludeEmail;

      /** Whether to always include a value in the "email" field for the organizer, creator and attendees,
     even if no real email is available (i.e. a generated, non-working value will be provided). The use
     of this option is discouraged and should only be used by clients which cannot handle the absence of
     an email address value in the mentioned places. Optional. The default is False.
       */
      public Boolean getAlwaysIncludeEmail() {
        return alwaysIncludeEmail;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      public Get setAlwaysIncludeEmail(Boolean alwaysIncludeEmail) {
        this.alwaysIncludeEmail = alwaysIncludeEmail;
        return this;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      @com.google.api.client.util.Key
      private Integer maxAttendees;

      /** The maximum number of attendees to include in the response. If there are more than the specified
     number of attendees, only the participant is returned. Optional.

     [minimum: 1]
       */
      public Integer getMaxAttendees() {
        return maxAttendees;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      public Get setMaxAttendees(Integer maxAttendees) {
        this.maxAttendees = maxAttendees;
        return this;
      }

    }
    /**
     * Moves an event to another calendar, i.e. changes an event's organizer.
     *
     * Create a request for the method "events.move".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Move#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier of the source calendar where the event currently is on.
     * @param eventId Event identifier.
     * @param destination Calendar identifier of the target calendar where the event is to be moved to.
     * @return the request
     */
    public Move move(String calendarId, String eventId, String destination) throws java.io.IOException {
      Move result = new Move(calendarId, eventId, destination);
      initialize(result);
      return result;
    }

    public class Move extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events/{eventId}/move";

      Move(String calendarId, String eventId, String destination) {
        super(Calendar.this, "POST", REST_PATH, null, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.eventId = Preconditions.checkNotNull(eventId, "Required parameter eventId must be specified.");
        this.destination = Preconditions.checkNotNull(destination, "Required parameter destination must be specified.");
      }

      @Override
      public Move setPrettyPrint(Boolean prettyPrint) {
        return (Move) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Move setFields(String fields) {
        return (Move) super.setFields(fields);
      }

      @Override
      public Move setQuotaUser(String quotaUser) {
        return (Move) super.setQuotaUser(quotaUser);
      }

      @Override
      public Move setOauthToken(String oauthToken) {
        return (Move) super.setOauthToken(oauthToken);
      }

      @Override
      public Move setKey(String key) {
        return (Move) super.setKey(key);
      }

      @Override
      public Move setUserIp(String userIp) {
        return (Move) super.setUserIp(userIp);
      }

      @Override
      public Move setAlt(String alt) {
        return (Move) super.setAlt(alt);
      }

      /** Calendar identifier of the source calendar where the event currently is on. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier of the source calendar where the event currently is on.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier of the source calendar where the event currently is on. */
      public Move setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** Event identifier. */
      @com.google.api.client.util.Key
      private String eventId;

      /** Event identifier.
       */
      public String getEventId() {
        return eventId;
      }

      /** Event identifier. */
      public Move setEventId(String eventId) {
        this.eventId = eventId;
        return this;
      }

      /** Calendar identifier of the target calendar where the event is to be moved to. */
      @com.google.api.client.util.Key
      private String destination;

      /** Calendar identifier of the target calendar where the event is to be moved to.
       */
      public String getDestination() {
        return destination;
      }

      /** Calendar identifier of the target calendar where the event is to be moved to. */
      public Move setDestination(String destination) {
        this.destination = destination;
        return this;
      }

      /**
     * Whether to send notifications about the change of the event's organizer. Optional. The
     * default is False.
     */
      @com.google.api.client.util.Key
      private Boolean sendNotifications;

      /** Whether to send notifications about the change of the event's organizer. Optional. The default is
     False.
       */
      public Boolean getSendNotifications() {
        return sendNotifications;
      }

      /**
     * Whether to send notifications about the change of the event's organizer. Optional. The
     * default is False.
     */
      public Move setSendNotifications(Boolean sendNotifications) {
        this.sendNotifications = sendNotifications;
        return this;
      }

    }
    /**
     * Returns events on the specified calendar.
     *
     * Create a request for the method "events.list".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link List#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @return the request
     */
    public List list(String calendarId) throws java.io.IOException {
      List result = new List(calendarId);
      initialize(result);
      return result;
    }

    public class List extends CalendarRequest<com.google.api.services.calendar.model.Events> {

      private static final String REST_PATH = "calendars/{calendarId}/events";

      List(String calendarId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Events.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public List setPrettyPrint(Boolean prettyPrint) {
        return (List) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public List setFields(String fields) {
        return (List) super.setFields(fields);
      }

      @Override
      public List setQuotaUser(String quotaUser) {
        return (List) super.setQuotaUser(quotaUser);
      }

      @Override
      public List setOauthToken(String oauthToken) {
        return (List) super.setOauthToken(oauthToken);
      }

      @Override
      public List setKey(String key) {
        return (List) super.setKey(key);
      }

      @Override
      public List setUserIp(String userIp) {
        return (List) super.setUserIp(userIp);
      }

      @Override
      public List setAlt(String alt) {
        return (List) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public List setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /**
     * The order of the events returned in the result. Optional. The default is an unspecified,
     * stable order.
     */
      @com.google.api.client.util.Key
      private String orderBy;

      /** The order of the events returned in the result. Optional. The default is an unspecified, stable
     order.
       */
      public String getOrderBy() {
        return orderBy;
      }

      /**
     * The order of the events returned in the result. Optional. The default is an unspecified,
     * stable order.
     */
      public List setOrderBy(String orderBy) {
        this.orderBy = orderBy;
        return this;
      }

      /** Whether to include hidden invitations in the result. Optional. The default is False. */
      @com.google.api.client.util.Key
      private Boolean showHiddenInvitations;

      /** Whether to include hidden invitations in the result. Optional. The default is False.
       */
      public Boolean getShowHiddenInvitations() {
        return showHiddenInvitations;
      }

      /** Whether to include hidden invitations in the result. Optional. The default is False. */
      public List setShowHiddenInvitations(Boolean showHiddenInvitations) {
        this.showHiddenInvitations = showHiddenInvitations;
        return this;
      }

      /**
     * Whether to include deleted single events (with 'status' equals 'cancelled') in the result.
     * Cancelled instances of recurring events will still be included if 'singleEvents' is False.
     * Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean showDeleted;

      /** Whether to include deleted single events (with 'status' equals 'cancelled') in the result.
     Cancelled instances of recurring events will still be included if 'singleEvents' is False.
     Optional. The default is False.
       */
      public Boolean getShowDeleted() {
        return showDeleted;
      }

      /**
     * Whether to include deleted single events (with 'status' equals 'cancelled') in the result.
     * Cancelled instances of recurring events will still be included if 'singleEvents' is False.
     * Optional. The default is False.
     */
      public List setShowDeleted(Boolean showDeleted) {
        this.showDeleted = showDeleted;
        return this;
      }

      /** Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional. */
      @com.google.api.client.util.Key
      private String iCalUID;

      /** Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional.
       */
      public String getICalUID() {
        return iCalUID;
      }

      /** Specifies iCalendar UID (iCalUID) of events to be included in the response. Optional. */
      public List setICalUID(String iCalUID) {
        this.iCalUID = iCalUID;
        return this;
      }

      /**
     * Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by.
     * Optional. The default is not to filter by last modification time.
     */
      @com.google.api.client.util.Key
      private DateTime updatedMin;

      /** Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. Optional.
     The default is not to filter by last modification time.
       */
      public DateTime getUpdatedMin() {
        return updatedMin;
      }

      /**
     * Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by.
     * Optional. The default is not to filter by last modification time.
     */
      public List setUpdatedMin(DateTime updatedMin) {
        this.updatedMin = updatedMin;
        return this;
      }

      /**
     * Whether to expand recurring events into instances and only return single one-off events and
     * instances of recurring events, but not the underlying recurring events themselves. Optional.
     * The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean singleEvents;

      /** Whether to expand recurring events into instances and only return single one-off events and
     instances of recurring events, but not the underlying recurring events themselves. Optional. The
     default is False.
       */
      public Boolean getSingleEvents() {
        return singleEvents;
      }

      /**
     * Whether to expand recurring events into instances and only return single one-off events and
     * instances of recurring events, but not the underlying recurring events themselves. Optional.
     * The default is False.
     */
      public List setSingleEvents(Boolean singleEvents) {
        this.singleEvents = singleEvents;
        return this;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      @com.google.api.client.util.Key
      private Boolean alwaysIncludeEmail;

      /** Whether to always include a value in the "email" field for the organizer, creator and attendees,
     even if no real email is available (i.e. a generated, non-working value will be provided). The use
     of this option is discouraged and should only be used by clients which cannot handle the absence of
     an email address value in the mentioned places. Optional. The default is False.
       */
      public Boolean getAlwaysIncludeEmail() {
        return alwaysIncludeEmail;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      public List setAlwaysIncludeEmail(Boolean alwaysIncludeEmail) {
        this.alwaysIncludeEmail = alwaysIncludeEmail;
        return this;
      }

      /** Maximum number of events returned on one result page. Optional. */
      @com.google.api.client.util.Key
      private Integer maxResults;

      /** Maximum number of events returned on one result page. Optional.

     [minimum: 1]
       */
      public Integer getMaxResults() {
        return maxResults;
      }

      /** Maximum number of events returned on one result page. Optional. */
      public List setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /**
     * Free text search terms to find events that match these terms in any field, except for
     * extended properties. Optional.
     */
      @com.google.api.client.util.Key
      private String q;

      /** Free text search terms to find events that match these terms in any field, except for extended
     properties. Optional.
       */
      public String getQ() {
        return q;
      }

      /**
     * Free text search terms to find events that match these terms in any field, except for
     * extended properties. Optional.
     */
      public List setQ(String q) {
        this.q = q;
        return this;
      }

      /** Token specifying which result page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Token specifying which result page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Token specifying which result page to return. Optional. */
      public List setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /**
     * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to
     * filter by end time.
     */
      @com.google.api.client.util.Key
      private DateTime timeMin;

      /** Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to
     filter by end time.
       */
      public DateTime getTimeMin() {
        return timeMin;
      }

      /**
     * Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to
     * filter by end time.
     */
      public List setTimeMin(DateTime timeMin) {
        this.timeMin = timeMin;
        return this;
      }

      /** Time zone used in the response. Optional. The default is the time zone of the calendar. */
      @com.google.api.client.util.Key
      private String timeZone;

      /** Time zone used in the response. Optional. The default is the time zone of the calendar.
       */
      public String getTimeZone() {
        return timeZone;
      }

      /** Time zone used in the response. Optional. The default is the time zone of the calendar. */
      public List setTimeZone(String timeZone) {
        this.timeZone = timeZone;
        return this;
      }

      /**
     * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not
     * to filter by start time.
     */
      @com.google.api.client.util.Key
      private DateTime timeMax;

      /** Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to
     filter by start time.
       */
      public DateTime getTimeMax() {
        return timeMax;
      }

      /**
     * Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not
     * to filter by start time.
     */
      public List setTimeMax(DateTime timeMax) {
        this.timeMax = timeMax;
        return this;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      @com.google.api.client.util.Key
      private Integer maxAttendees;

      /** The maximum number of attendees to include in the response. If there are more than the specified
     number of attendees, only the participant is returned. Optional.

     [minimum: 1]
       */
      public Integer getMaxAttendees() {
        return maxAttendees;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      public List setMaxAttendees(Integer maxAttendees) {
        this.maxAttendees = maxAttendees;
        return this;
      }

    }
    /**
     * Updates an event.
     *
     * Create a request for the method "events.update".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Update#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param eventId Event identifier.
     * @param content the {@link com.google.api.services.calendar.model.Event}
     * @return the request
     */
    public Update update(String calendarId, String eventId, com.google.api.services.calendar.model.Event content) throws java.io.IOException {
      Update result = new Update(calendarId, eventId, content);
      initialize(result);
      return result;
    }

    public class Update extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events/{eventId}";

      Update(String calendarId, String eventId, com.google.api.services.calendar.model.Event content) {
        super(Calendar.this, "PUT", REST_PATH, content, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.eventId = Preconditions.checkNotNull(eventId, "Required parameter eventId must be specified.");
      }

      @Override
      public Update setPrettyPrint(Boolean prettyPrint) {
        return (Update) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Update setFields(String fields) {
        return (Update) super.setFields(fields);
      }

      @Override
      public Update setQuotaUser(String quotaUser) {
        return (Update) super.setQuotaUser(quotaUser);
      }

      @Override
      public Update setOauthToken(String oauthToken) {
        return (Update) super.setOauthToken(oauthToken);
      }

      @Override
      public Update setKey(String key) {
        return (Update) super.setKey(key);
      }

      @Override
      public Update setUserIp(String userIp) {
        return (Update) super.setUserIp(userIp);
      }

      @Override
      public Update setAlt(String alt) {
        return (Update) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Update setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** Event identifier. */
      @com.google.api.client.util.Key
      private String eventId;

      /** Event identifier.
       */
      public String getEventId() {
        return eventId;
      }

      /** Event identifier. */
      public Update setEventId(String eventId) {
        this.eventId = eventId;
        return this;
      }

      /**
     * Whether to send notifications about the event update (e.g. attendee's responses, title
     * changes, etc.). Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean sendNotifications;

      /** Whether to send notifications about the event update (e.g. attendee's responses, title changes,
     etc.). Optional. The default is False.
       */
      public Boolean getSendNotifications() {
        return sendNotifications;
      }

      /**
     * Whether to send notifications about the event update (e.g. attendee's responses, title
     * changes, etc.). Optional. The default is False.
     */
      public Update setSendNotifications(Boolean sendNotifications) {
        this.sendNotifications = sendNotifications;
        return this;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      @com.google.api.client.util.Key
      private Boolean alwaysIncludeEmail;

      /** Whether to always include a value in the "email" field for the organizer, creator and attendees,
     even if no real email is available (i.e. a generated, non-working value will be provided). The use
     of this option is discouraged and should only be used by clients which cannot handle the absence of
     an email address value in the mentioned places. Optional. The default is False.
       */
      public Boolean getAlwaysIncludeEmail() {
        return alwaysIncludeEmail;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      public Update setAlwaysIncludeEmail(Boolean alwaysIncludeEmail) {
        this.alwaysIncludeEmail = alwaysIncludeEmail;
        return this;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      @com.google.api.client.util.Key
      private Integer maxAttendees;

      /** The maximum number of attendees to include in the response. If there are more than the specified
     number of attendees, only the participant is returned. Optional.

     [minimum: 1]
       */
      public Integer getMaxAttendees() {
        return maxAttendees;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      public Update setMaxAttendees(Integer maxAttendees) {
        this.maxAttendees = maxAttendees;
        return this;
      }

    }
    /**
     * Updates an event. This method supports patch semantics.
     *
     * Create a request for the method "events.patch".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Patch#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param eventId Event identifier.
     * @param content the {@link com.google.api.services.calendar.model.Event}
     * @return the request
     */
    public Patch patch(String calendarId, String eventId, com.google.api.services.calendar.model.Event content) throws java.io.IOException {
      Patch result = new Patch(calendarId, eventId, content);
      initialize(result);
      return result;
    }

    public class Patch extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events/{eventId}";

      Patch(String calendarId, String eventId, com.google.api.services.calendar.model.Event content) {
        super(Calendar.this, "PATCH", REST_PATH, content, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.eventId = Preconditions.checkNotNull(eventId, "Required parameter eventId must be specified.");
      }

      @Override
      public Patch setPrettyPrint(Boolean prettyPrint) {
        return (Patch) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Patch setFields(String fields) {
        return (Patch) super.setFields(fields);
      }

      @Override
      public Patch setQuotaUser(String quotaUser) {
        return (Patch) super.setQuotaUser(quotaUser);
      }

      @Override
      public Patch setOauthToken(String oauthToken) {
        return (Patch) super.setOauthToken(oauthToken);
      }

      @Override
      public Patch setKey(String key) {
        return (Patch) super.setKey(key);
      }

      @Override
      public Patch setUserIp(String userIp) {
        return (Patch) super.setUserIp(userIp);
      }

      @Override
      public Patch setAlt(String alt) {
        return (Patch) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Patch setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** Event identifier. */
      @com.google.api.client.util.Key
      private String eventId;

      /** Event identifier.
       */
      public String getEventId() {
        return eventId;
      }

      /** Event identifier. */
      public Patch setEventId(String eventId) {
        this.eventId = eventId;
        return this;
      }

      /**
     * Whether to send notifications about the event update (e.g. attendee's responses, title
     * changes, etc.). Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean sendNotifications;

      /** Whether to send notifications about the event update (e.g. attendee's responses, title changes,
     etc.). Optional. The default is False.
       */
      public Boolean getSendNotifications() {
        return sendNotifications;
      }

      /**
     * Whether to send notifications about the event update (e.g. attendee's responses, title
     * changes, etc.). Optional. The default is False.
     */
      public Patch setSendNotifications(Boolean sendNotifications) {
        this.sendNotifications = sendNotifications;
        return this;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      @com.google.api.client.util.Key
      private Boolean alwaysIncludeEmail;

      /** Whether to always include a value in the "email" field for the organizer, creator and attendees,
     even if no real email is available (i.e. a generated, non-working value will be provided). The use
     of this option is discouraged and should only be used by clients which cannot handle the absence of
     an email address value in the mentioned places. Optional. The default is False.
       */
      public Boolean getAlwaysIncludeEmail() {
        return alwaysIncludeEmail;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      public Patch setAlwaysIncludeEmail(Boolean alwaysIncludeEmail) {
        this.alwaysIncludeEmail = alwaysIncludeEmail;
        return this;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      @com.google.api.client.util.Key
      private Integer maxAttendees;

      /** The maximum number of attendees to include in the response. If there are more than the specified
     number of attendees, only the participant is returned. Optional.

     [minimum: 1]
       */
      public Integer getMaxAttendees() {
        return maxAttendees;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      public Patch setMaxAttendees(Integer maxAttendees) {
        this.maxAttendees = maxAttendees;
        return this;
      }

    }
    /**
     * Returns instances of the specified recurring event.
     *
     * Create a request for the method "events.instances".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Instances#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param eventId Recurring event identifier.
     * @return the request
     */
    public Instances instances(String calendarId, String eventId) throws java.io.IOException {
      Instances result = new Instances(calendarId, eventId);
      initialize(result);
      return result;
    }

    public class Instances extends CalendarRequest<com.google.api.services.calendar.model.Events> {

      private static final String REST_PATH = "calendars/{calendarId}/events/{eventId}/instances";

      Instances(String calendarId, String eventId) {
        super(Calendar.this, "GET", REST_PATH, null, com.google.api.services.calendar.model.Events.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.eventId = Preconditions.checkNotNull(eventId, "Required parameter eventId must be specified.");
      }

      @Override
      public com.google.api.client.http.HttpResponse executeUsingHead() throws java.io.IOException {
        return super.executeUsingHead();
      }

      @Override
      public com.google.api.client.http.HttpRequest buildHttpRequestUsingHead() throws java.io.IOException {
        return super.buildHttpRequestUsingHead();
      }

      @Override
      public Instances setPrettyPrint(Boolean prettyPrint) {
        return (Instances) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Instances setFields(String fields) {
        return (Instances) super.setFields(fields);
      }

      @Override
      public Instances setQuotaUser(String quotaUser) {
        return (Instances) super.setQuotaUser(quotaUser);
      }

      @Override
      public Instances setOauthToken(String oauthToken) {
        return (Instances) super.setOauthToken(oauthToken);
      }

      @Override
      public Instances setKey(String key) {
        return (Instances) super.setKey(key);
      }

      @Override
      public Instances setUserIp(String userIp) {
        return (Instances) super.setUserIp(userIp);
      }

      @Override
      public Instances setAlt(String alt) {
        return (Instances) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Instances setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** Recurring event identifier. */
      @com.google.api.client.util.Key
      private String eventId;

      /** Recurring event identifier.
       */
      public String getEventId() {
        return eventId;
      }

      /** Recurring event identifier. */
      public Instances setEventId(String eventId) {
        this.eventId = eventId;
        return this;
      }

      /**
     * Whether to include deleted events (with 'eventStatus' equals 'cancelled') in the result.
     * Optional. The default is False.
     */
      @com.google.api.client.util.Key
      private Boolean showDeleted;

      /** Whether to include deleted events (with 'eventStatus' equals 'cancelled') in the result. Optional.
     The default is False.
       */
      public Boolean getShowDeleted() {
        return showDeleted;
      }

      /**
     * Whether to include deleted events (with 'eventStatus' equals 'cancelled') in the result.
     * Optional. The default is False.
     */
      public Instances setShowDeleted(Boolean showDeleted) {
        this.showDeleted = showDeleted;
        return this;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      @com.google.api.client.util.Key
      private Boolean alwaysIncludeEmail;

      /** Whether to always include a value in the "email" field for the organizer, creator and attendees,
     even if no real email is available (i.e. a generated, non-working value will be provided). The use
     of this option is discouraged and should only be used by clients which cannot handle the absence of
     an email address value in the mentioned places. Optional. The default is False.
       */
      public Boolean getAlwaysIncludeEmail() {
        return alwaysIncludeEmail;
      }

      /**
     * Whether to always include a value in the "email" field for the organizer, creator and
     * attendees, even if no real email is available (i.e. a generated, non-working value will be
     * provided). The use of this option is discouraged and should only be used by clients which
     * cannot handle the absence of an email address value in the mentioned places. Optional. The
     * default is False.
     */
      public Instances setAlwaysIncludeEmail(Boolean alwaysIncludeEmail) {
        this.alwaysIncludeEmail = alwaysIncludeEmail;
        return this;
      }

      /** Maximum number of events returned on one result page. Optional. */
      @com.google.api.client.util.Key
      private Integer maxResults;

      /** Maximum number of events returned on one result page. Optional.

     [minimum: 1]
       */
      public Integer getMaxResults() {
        return maxResults;
      }

      /** Maximum number of events returned on one result page. Optional. */
      public Instances setMaxResults(Integer maxResults) {
        this.maxResults = maxResults;
        return this;
      }

      /** Token specifying which result page to return. Optional. */
      @com.google.api.client.util.Key
      private String pageToken;

      /** Token specifying which result page to return. Optional.
       */
      public String getPageToken() {
        return pageToken;
      }

      /** Token specifying which result page to return. Optional. */
      public Instances setPageToken(String pageToken) {
        this.pageToken = pageToken;
        return this;
      }

      /** Time zone used in the response. Optional. The default is the time zone of the calendar. */
      @com.google.api.client.util.Key
      private String timeZone;

      /** Time zone used in the response. Optional. The default is the time zone of the calendar.
       */
      public String getTimeZone() {
        return timeZone;
      }

      /** Time zone used in the response. Optional. The default is the time zone of the calendar. */
      public Instances setTimeZone(String timeZone) {
        this.timeZone = timeZone;
        return this;
      }

      /** The original start time of the instance in the result. Optional. */
      @com.google.api.client.util.Key
      private String originalStart;

      /** The original start time of the instance in the result. Optional.
       */
      public String getOriginalStart() {
        return originalStart;
      }

      /** The original start time of the instance in the result. Optional. */
      public Instances setOriginalStart(String originalStart) {
        this.originalStart = originalStart;
        return this;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      @com.google.api.client.util.Key
      private Integer maxAttendees;

      /** The maximum number of attendees to include in the response. If there are more than the specified
     number of attendees, only the participant is returned. Optional.

     [minimum: 1]
       */
      public Integer getMaxAttendees() {
        return maxAttendees;
      }

      /**
     * The maximum number of attendees to include in the response. If there are more than the
     * specified number of attendees, only the participant is returned. Optional.
     */
      public Instances setMaxAttendees(Integer maxAttendees) {
        this.maxAttendees = maxAttendees;
        return this;
      }

    }
    /**
     * Imports an event.
     *
     * Create a request for the method "events.import".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link CalendarImport#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param content the {@link com.google.api.services.calendar.model.Event}
     * @return the request
     */
    public CalendarImport calendarImport(String calendarId, com.google.api.services.calendar.model.Event content) throws java.io.IOException {
      CalendarImport result = new CalendarImport(calendarId, content);
      initialize(result);
      return result;
    }

    public class CalendarImport extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events/import";

      CalendarImport(String calendarId, com.google.api.services.calendar.model.Event content) {
        super(Calendar.this, "POST", REST_PATH, content, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
      }

      @Override
      public CalendarImport setPrettyPrint(Boolean prettyPrint) {
        return (CalendarImport) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public CalendarImport setFields(String fields) {
        return (CalendarImport) super.setFields(fields);
      }

      @Override
      public CalendarImport setQuotaUser(String quotaUser) {
        return (CalendarImport) super.setQuotaUser(quotaUser);
      }

      @Override
      public CalendarImport setOauthToken(String oauthToken) {
        return (CalendarImport) super.setOauthToken(oauthToken);
      }

      @Override
      public CalendarImport setKey(String key) {
        return (CalendarImport) super.setKey(key);
      }

      @Override
      public CalendarImport setUserIp(String userIp) {
        return (CalendarImport) super.setUserIp(userIp);
      }

      @Override
      public CalendarImport setAlt(String alt) {
        return (CalendarImport) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public CalendarImport setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

    }
    /**
     * Creates an event based on a simple text string.
     *
     * Create a request for the method "events.quickAdd".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link QuickAdd#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param text The text describing the event to be created.
     * @return the request
     */
    public QuickAdd quickAdd(String calendarId, String text) throws java.io.IOException {
      QuickAdd result = new QuickAdd(calendarId, text);
      initialize(result);
      return result;
    }

    public class QuickAdd extends CalendarRequest<com.google.api.services.calendar.model.Event> {

      private static final String REST_PATH = "calendars/{calendarId}/events/quickAdd";

      QuickAdd(String calendarId, String text) {
        super(Calendar.this, "POST", REST_PATH, null, com.google.api.services.calendar.model.Event.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.text = Preconditions.checkNotNull(text, "Required parameter text must be specified.");
      }

      @Override
      public QuickAdd setPrettyPrint(Boolean prettyPrint) {
        return (QuickAdd) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public QuickAdd setFields(String fields) {
        return (QuickAdd) super.setFields(fields);
      }

      @Override
      public QuickAdd setQuotaUser(String quotaUser) {
        return (QuickAdd) super.setQuotaUser(quotaUser);
      }

      @Override
      public QuickAdd setOauthToken(String oauthToken) {
        return (QuickAdd) super.setOauthToken(oauthToken);
      }

      @Override
      public QuickAdd setKey(String key) {
        return (QuickAdd) super.setKey(key);
      }

      @Override
      public QuickAdd setUserIp(String userIp) {
        return (QuickAdd) super.setUserIp(userIp);
      }

      @Override
      public QuickAdd setAlt(String alt) {
        return (QuickAdd) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public QuickAdd setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** The text describing the event to be created. */
      @com.google.api.client.util.Key
      private String text;

      /** The text describing the event to be created.
       */
      public String getText() {
        return text;
      }

      /** The text describing the event to be created. */
      public QuickAdd setText(String text) {
        this.text = text;
        return this;
      }

      /**
     * Whether to send notifications about the creation of the event. Optional. The default is
     * False.
     */
      @com.google.api.client.util.Key
      private Boolean sendNotifications;

      /** Whether to send notifications about the creation of the event. Optional. The default is False.
       */
      public Boolean getSendNotifications() {
        return sendNotifications;
      }

      /**
     * Whether to send notifications about the creation of the event. Optional. The default is
     * False.
     */
      public QuickAdd setSendNotifications(Boolean sendNotifications) {
        this.sendNotifications = sendNotifications;
        return this;
      }

    }
    /**
     * Deletes an event.
     *
     * Create a request for the method "events.delete".
     *
     * This request holds the parameters needed by the the calendar server.  After setting any optional
     * parameters, call the {@link Delete#execute()} method to invoke the remote operation.
     *
     * @param calendarId Calendar identifier.
     * @param eventId Event identifier.
     * @return the request
     */
    public Delete delete(String calendarId, String eventId) throws java.io.IOException {
      Delete result = new Delete(calendarId, eventId);
      initialize(result);
      return result;
    }

    public class Delete extends CalendarRequest<Void> {

      private static final String REST_PATH = "calendars/{calendarId}/events/{eventId}";

      Delete(String calendarId, String eventId) {
        super(Calendar.this, "DELETE", REST_PATH, null, Void.class);
        this.calendarId = Preconditions.checkNotNull(calendarId, "Required parameter calendarId must be specified.");
        this.eventId = Preconditions.checkNotNull(eventId, "Required parameter eventId must be specified.");
      }

      @Override
      public Delete setPrettyPrint(Boolean prettyPrint) {
        return (Delete) super.setPrettyPrint(prettyPrint);
      }

      @Override
      public Delete setFields(String fields) {
        return (Delete) super.setFields(fields);
      }

      @Override
      public Delete setQuotaUser(String quotaUser) {
        return (Delete) super.setQuotaUser(quotaUser);
      }

      @Override
      public Delete setOauthToken(String oauthToken) {
        return (Delete) super.setOauthToken(oauthToken);
      }

      @Override
      public Delete setKey(String key) {
        return (Delete) super.setKey(key);
      }

      @Override
      public Delete setUserIp(String userIp) {
        return (Delete) super.setUserIp(userIp);
      }

      @Override
      public Delete setAlt(String alt) {
        return (Delete) super.setAlt(alt);
      }

      /** Calendar identifier. */
      @com.google.api.client.util.Key
      private String calendarId;

      /** Calendar identifier.
       */
      public String getCalendarId() {
        return calendarId;
      }

      /** Calendar identifier. */
      public Delete setCalendarId(String calendarId) {
        this.calendarId = calendarId;
        return this;
      }

      /** Event identifier. */
      @com.google.api.client.util.Key
      private String eventId;

      /** Event identifier.
       */
      public String getEventId() {
        return eventId;
      }

      /** Event identifier. */
      public Delete setEventId(String eventId) {
        this.eventId = eventId;
        return this;
      }

      /**
     * Whether to send notifications about the deletion of the event. Optional. The default is
     * False.
     */
      @com.google.api.client.util.Key
      private Boolean sendNotifications;

      /** Whether to send notifications about the deletion of the event. Optional. The default is False.
       */
      public Boolean getSendNotifications() {
        return sendNotifications;
      }

      /**
     * Whether to send notifications about the deletion of the event. Optional. The default is
     * False.
     */
      public Delete setSendNotifications(Boolean sendNotifications) {
        this.sendNotifications = sendNotifications;
        return this;
      }

    }

  }

  /**
   * Builder for {@link Calendar}.
   *
   * <p>
   * Implementation is not thread-safe.
   * </p>
   *
   * @since 1.3.0
   */
  public static final class Builder extends AbstractGoogleJsonClient.Builder {

    /**
     * Returns an instance of a new builder.
     *
     * @param transport HTTP transport
     * @param jsonFactory JSON factory
     * @param httpRequestInitializer HTTP request initializer or {@code null} for none
     * @since 1.7
     */
    public Builder(HttpTransport transport, JsonFactory jsonFactory,
        HttpRequestInitializer httpRequestInitializer) {
      super(
          transport,
          jsonFactory,
          DEFAULT_ROOT_URL,
          DEFAULT_SERVICE_PATH,
          httpRequestInitializer,
          false);
    }

    /** Builds a new instance of {@link Calendar}. */
    @Override
    public Calendar build() {
      return new Calendar(getTransport(),
          getHttpRequestInitializer(),
          getRootUrl(),
          getServicePath(),
          getObjectParser(),
          getGoogleClientRequestInitializer(),
          getApplicationName(),
          getSuppressPatternChecks());
    }

    @Override
    public Builder setRootUrl(String rootUrl) {
      return (Builder) super.setRootUrl(rootUrl);
    }

    @Override
    public Builder setServicePath(String servicePath) {
      return (Builder) super.setServicePath(servicePath);
    }

    @Override
    public Builder setHttpRequestInitializer(HttpRequestInitializer httpRequestInitializer) {
      return (Builder) super.setHttpRequestInitializer(httpRequestInitializer);
    }

    @Override
    public Builder setApplicationName(String applicationName) {
      return (Builder) super.setApplicationName(applicationName);
    }

    @Override
    public Builder setSuppressPatternChecks(boolean suppressPatternChecks) {
      return (Builder) super.setSuppressPatternChecks(suppressPatternChecks);
    }

    /**
     * Set the {@link CalendarRequestInitializer}.
     *
     * @since 1.12
     */
    public Builder setCalendarRequestInitializer(
        CalendarRequestInitializer calendarRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(calendarRequestInitializer);
    }

    @Override
    public Builder setGoogleClientRequestInitializer(
        GoogleClientRequestInitializer googleClientRequestInitializer) {
      return (Builder) super.setGoogleClientRequestInitializer(googleClientRequestInitializer);
    }
  }
}
